{{^usesTypedKeys}}
    {{#discriminated}}
        protected static void setup{{className}}Deserializer({{TYPES.Client.Json.ObjectDeserializer}}<Builder> op) {
        {{#extendsOtherShape}}
            setup{{extendsType.name}}Deserializer(op{{#extendsType.typeParams}}, {{>Type/deserializer}}{{/extendsType.typeParams}});
        {{/extendsOtherShape}}
        {{>ObjectShape/Deserialize/Fields}}
        {{#variants}}
            op.add(Builder::{{#asFieldName}}{{name}}{{/asFieldName}}, {{#type}}{{>Type/deserializer}}{{/type}}, {{#quoted}}{{name}}{{/quoted}});
        {{/variants}}
        {{#internallyDiscriminated}}
            op.setTypeProperty({{#quoted}}{{discriminatingField}}{{/quoted}}, {{#defaultVariant}}Kind.{{#pascalCase}}{{name}}{{/pascalCase}}.jsonValue(){{/defaultVariant}}{{^defaultVariant}}null{{/defaultVariant}});
        {{/internallyDiscriminated}}
        {{#singleKeyMap}}
            op.setKey(Builder::{{name}}, {{#type}}{{>Type/deserializer}}{{/type}});
        {{/singleKeyMap}}
        }

        public static final {{TYPES.Client.Json.JsonpDeserializer}}<{{className}}> _DESERIALIZER = {{TYPES.Client.Json.ObjectBuilderDeserializer}}.lazy(Builder::new, {{className}}::setup{{className}}Deserializer, Builder::build);
    {{/discriminated}}
    {{^discriminated}}
        {{^typeParameters}}
            private static {{TYPES.Client.Json.JsonpDeserializer}}<{{className}}> build{{className}}Deserializer() {
        {{/typeParameters}}
        {{#typeParameters}}
                public static {{.}} {{TYPES.Client.Json.JsonpDeserializer}}<{{selfType}}> create{{className}}Deserializer({{>Partials/Deserialize/TypeParameterDeserializerParams}}) {
        {{/typeParameters}}
                return new {{TYPES.Client.Json.UnionDeserializer.builderType}}<{{selfType}}, Kind, Object>({{selfType}}::new, {{hasAmbiguities}})
            {{#variants}}.addMember(Kind.{{#pascalCase}}{{name}}{{/pascalCase}}, {{#type}}{{>Type/deserializer}}{{/type}}){{/variants}}
                .build();
            }

        {{^typeParameters}}
            public static final {{TYPES.Client.Json.JsonpDeserializer}}<{{className}}> _DESERIALIZER = {{TYPES.Client.Json.JsonpDeserializer}}.lazy({{className}}::build{{className}}Deserializer);

        {{/typeParameters}}
    {{/discriminated}}
{{/usesTypedKeys}}
{{#usesTypedKeys}}
    {{#typeParameters}}
        public static {{.}} {{TYPES.Client.Json.ExternallyTaggedUnion}}.TypedKeysDeserializer<{{selfType}}> create{{className}}Deserializer({{>Partials/Deserialize/TypeParameterDeserializerParams}}) {
    {{/typeParameters}}
    {{^typeParameters}}
        public static final {{TYPES.Client.Json.ExternallyTaggedUnion}}.TypedKeysDeserializer<{{className}}> _TYPED_KEYS_DESERIALIZER;

        static {
    {{/typeParameters}}
            {{TYPES.Java.Util.Map}}<String, {{TYPES.Client.Json.JsonpDeserializer}}<? extends {{variantBaseType}}>> deserializers = new {{TYPES.Java.Util.HashMap}}<>();
            {{#variants}}
                deserializers.put({{#quoted}}{{name}}{{/quoted}}, {{#type}}{{>Type/deserializer}}{{/type}});
            {{/variants}}

    {{#typeParameters}}
            return new {{TYPES.Client.Json.ExternallyTaggedUnion}}.Deserializer<>(deserializers, {{selfType}}::new).typedKeys();
    {{/typeParameters}}
    {{^typeParameters}}
            _TYPED_KEYS_DESERIALIZER = new {{TYPES.Client.Json.ExternallyTaggedUnion}}.Deserializer<>(deserializers, {{selfType}}::new).typedKeys();
    {{/typeParameters}}
        }
{{/usesTypedKeys}}